import requests

import json

text_input = input('please input:')

while True:
    data = {
        "perception": {
            "inputText": {
                "text": text_input
            },

            "selfInfo": {
                "location": {
                    "city": "北京",
                    "province": "北京",
                    "street": "信息路"
                }
            }
        },
        "userInfo": {
            "apiKey": "771a5d9324ae478cab243948bd98abef",
            "userId": "OnlyUseAlphabet"
        }
    }

    data = json.dumps(data).encode('utf8')
    response = requests.post('http://openapi.tuling123.com/openapi/api/v2',data=data)
    response = response.json()

    print(response['results'][0]['values']['text'])
